package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GoodsGroupMapper;
import com.ruoyi.system.domain.GoodsGroup;
import com.ruoyi.system.service.IGoodsGroupService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商品组基础Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-22
 */
@Service
public class GoodsGroupServiceImpl implements IGoodsGroupService 
{
    @Autowired
    private GoodsGroupMapper goodsGroupMapper;

    /**
     * 查询商品组基础
     * 
     * @param id 商品组基础主键
     * @return 商品组基础
     */
    @Override
    public GoodsGroup selectGoodsGroupById(Long id)
    {
        return goodsGroupMapper.selectGoodsGroupById(id);
    }

    /**
     * 查询商品组基础列表
     * 
     * @param goodsGroup 商品组基础
     * @return 商品组基础
     */
    @Override
    public List<GoodsGroup> selectGoodsGroupList(GoodsGroup goodsGroup)
    {
        return goodsGroupMapper.selectGoodsGroupList(goodsGroup);
    }

    /**
     * 新增商品组基础
     * 
     * @param goodsGroup 商品组基础
     * @return 结果
     */
    @Override
    public int insertGoodsGroup(GoodsGroup goodsGroup)
    {
        goodsGroup.setCreateTime(DateUtils.getNowDate());
        return goodsGroupMapper.insertGoodsGroup(goodsGroup);
    }

    /**
     * 修改商品组基础
     * 
     * @param goodsGroup 商品组基础
     * @return 结果
     */
    @Override
    public int updateGoodsGroup(GoodsGroup goodsGroup)
    {
        goodsGroup.setUpdateTime(DateUtils.getNowDate());
        return goodsGroupMapper.updateGoodsGroup(goodsGroup);
    }

    /**
     * 批量删除商品组基础
     * 
     * @param ids 需要删除的商品组基础主键
     * @return 结果
     */
    @Override
    public int deleteGoodsGroupByIds(String ids)
    {
        return goodsGroupMapper.deleteGoodsGroupByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商品组基础信息
     * 
     * @param id 商品组基础主键
     * @return 结果
     */
    @Override
    public int deleteGoodsGroupById(Long id)
    {
        return goodsGroupMapper.deleteGoodsGroupById(id);
    }
}
